package com.entity;

import com.mybatisflex.annotation.*;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 *  实体类。
 *
 * @author admin
 * @since 2024-06-04
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table("f_cart")
public class FCart implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 索引
     */
    @Id(keyType = KeyType.Auto)
    private Integer id;

    /**
     * 购物车物品数量
     */
    private Integer num;

    @Column(ignore = true)
    private BigDecimal totalPrice;

    /**
     * 用户id
     */
    private Integer userId;
    @RelationManyToMany(
            joinTable = "f_cart_goods",
            joinSelfColumn = "cart_id",
            joinTargetColumn = "goods_id"
    )
    private List<BGoods> goods;
}
